Droplet-based logic gates simulation of viscoelastic fluids under electric field

Nano and microfluidic technologies have shown great promise in the development of controlled drug delivery systems and the creation of microfluidic devices with logic-like functionalities. Here, we focused on investigating a droplet-based logic gate that can be used for automating medical diagnostic assays. This logic gate uses viscoelastic fluids, which are particularly relevant since bio-fluids exhibit viscoelastic properties. The operation of the logic gate is determined by evaluating various parameters, including the Weissenberg number, the Capillary number, and geometric factors. To effectively classify the logic gates operational conditions, we employed a deep learning classification to develop a reduced-order model. This approach accelerates the prediction of operating conditions, eliminating the need for complex simulations. Moreover, the deep learning model allows for the combination of different AND/OR branches, further enhancing the versatility of the logic gate. We also found that non-operating regions, where the logic gate does not function properly, can be transformed into operational regions by applying an external force. By utilizing an electrical induction technique, we demonstrated that the application of an electric field can repel or attract droplets, thereby improving the performance of the logic gate. Overall, our research shows the potential of the droplet-based logic gates in the field of medical diagnostics. The integration of deep learning classification algorithms enables rapid evaluation of operational conditions and facilitates the design of complex logic circuits. Additionally, the introduction of external forces and electrical induction techniques opens up new possibilities for enhancing the functionality and reliability of these logic gates.


Mathematical models and numerical methods
In order to simulate the complexity of electrohydrodynamic phenomena, a formulation for describing how the electric field affects the droplet dynamics is needed.Here, a charge-conservative equation to solve multiphase electrohydrodynamic problems is developed by employing the volume of fluid method and Maxwell equations as electroquasistatic 36 , ignoring the magnetic effects.For the behavior of the phases, a volume of fluid (SVOF) method is used to capture the interface, and the iso-advector 37 to reconstruct the interface position and curvature.For the capillary stress and the electric stress, the continuous surface tension force methodology and Maxwell's equation is coupled with the SVOF and the iso-advector approach since the curvature must be calculated accurately.This section presents the mathematical and numerical models utilized in this work.

Immiscible two-phase model
The governing equations for multiphase flow are the momentum equations, with the interface forces incorporated as a source term, as in 38 .The total mass conservation equation, where ρ and u are the density and velocity field, respectively, is: The momentum equations for incompressible, viscous, and immiscible two-fluid systems can be written as: where g and p are gravitational acceleration and pressure, respectively.∇ • τ is the viscous force.F e is the electric body force calculated from the Maxwell stress tensor acting at the fluid-fluid interface 39 .F γ is the surface tension force which is modeled as a volumetric force using the continuum surface force (CSF): where γ is the surface tension, α is the fluid volume fraction and κ is the interfacial curvature defined as: The volume of fluid (VOF) approach uses the volume fraction conservation equation to capture the interface, The multiphase system thermophysical properties are calculated according to: where θ is any mixture property, calculated by a weighted average of properties of the pure fluids ( θ 1 and θ 2 ) with respect to their volumetric fractions.

Viscoelastic model
Here, we are interested in viscoelastic fluids.Thus, to predict the viscous force, ∇ • τ , we used the Oldroyd-B model 40 .This constitutive model describes a polymeric stress tensor (with large deformations), where an extension of the Upper Convected Maxwell model represents an idealized fluid with elastic bead and spring dumbbells.In Oldroyd-B, the viscoelastic part is separated from the Newtonian part as follows: where τ s = µ s S is the solvent stress tensor.In this case, S is the deformation rate tensor or rate of strain tensor, S = 1 2 ∇v + (∇v) T , and µ s is the Newtonian viscosity.τ p is the viscoelastic stress tensor whose behavior is described as: where µ p is the viscoelastic viscosity, is the relaxation time and τ p is the upper-convected time derivative of the stress tensor, described by:

Maxwell equations
Herein, the Maxwell equations are approximated as electroquasistatic, ignoring the magnetic effects 36,39 .As the dynamic currents are small, the electric field is irrotational; thus, we have: where E is the electric field.After applying Gauss' law, Eq. ( 10) can be reduced to: where ǫ and ρ e are the dielectric permittivity and the bulk-free charge density, respectively.The conservation equation for the bulk free charge density is based on the assumption that each fluid has different electrical properties, yielding: (1) ∂ρ ∂t + ∇ • (ρu) = 0. (2) ( where σ is the conductivity.Finally, the Maxwell stress, τ e , neglecting the electrostriction effect, can be expressed as: where I is the second-order identity tensor.The bulk electric force, present in Eq. ( 2), can be derived from the divergent of Maxwell stress tensor, Eq. ( 13):

Numerical approach
The electrohydrodynamic multiphase flow framework was implemented and simulated in OpenFOAM 41 , a C++ open-source project for developing customized numerical solvers specialized in computational fluid dynamics (CFD), due to its large number of solvers and utilities.In order to simulate the droplet dynamics in the logic gate device, we developed a numerical solver based on an open-source toolbox to simulate the flow of viscoelastic fluids called RheoTool 42 , based on OpenFOAM-4.0.
The interIsoFoam solver, a VOF method that tracks the fluid-fluid interface, was adapted to include the RheoTool viscoelastic library.In interIsoFoam the CSF model calculates the surface tension effects, and the isoadvector 37 algorithm reconstructs the interface position and curvature.To predict the electric force (Eq.14), the charge-conservative equations (Eqs.11, 12) were implemented as a library in OpenFOAM 41 .Then, Eq. ( 14) is included as a source term in Eq. ( 2).The resulting solver includes three multiphysics models: several viscoelastic fluid models, the electroquasistatic model, and the Two-Phase Immiscible model, based on iso-advector interface reconstruction.
The pressure implicit with splitting of operators (PISO) algorithm is used to couple the pressure-velocity in the momentum equation 43 .The electroquasistatic model (Eqs.11, 12) is evaluated sequentially after updating the pressure equation in the PISO loop, and the electric force (Eq.14) is included in the momentum equation explicitly.Then, the effect of changes in charge density and the electric field is fully incorporated in the pressurevelocity coupling algorithm, ensuring a global convergence of the system of equations.
The temporal terms are discretized using a second-order implicit Euler scheme.Spatial discretization is performed using a second-order upwind scheme for the momentum equation and van Leer limiter to keep the phase fraction advection bounded.A linear scheme was applied for the Laplacian operator, which is also second order accurate.In order to respect the Courant-Friedrichs-Lewy (CFL) condition, the time step is limited by a fixed Courant Number (Co) less than 0.3 for the whole domain and all equations.Gmsh 44 , a free mesh generator, was used to build the geometries and the meshes.See in Fig. 1 the algorithm proposed for simulatons:

Simulated conditions
In this section, we describe the physical conditions of the simulations used in code verification, in the logic gate evaluation under viscoelastic fluid flow and in the training of the Binary Classification ROM.
To verify the multiphysics electrohydrodynamic solver, a circular droplet suspended in an immiscible fluid is placed between two parallel eletrodes with a constant electric field.We perform simulations for both Newtonian and viscoelastic fluids, and compared the observed deformation against predictions of the Taylor-theory 45 .The distance between the two plates is H d = 10R d , where R d is the initial radius of the droplet.Here, three dimen- sionless parameters are defined, R = σ 1 σ 2 , β = ν 1 ν 2 and Q = ǫ 1 ǫ 2 , where ν = µ ρ and the subscript denotes fluid one or two, dispersed and continuous phase, respectively.As in 46 , the simulations were performed in an axisymmetric geometry.The computational domain has 200 × 200 mesh nodes with R d = 0.1 cm, leading to a domain physical ( 13) The Newtonian droplet simulation use conditions similar to those used by 46 , with varying 2 < R < 14 and fixed Q 45 theory, the deformation parameter, D, can be expressed as a function of the fluid properties and the electric field strength, where H and L are the droplet lengths perpendicular and parallel to the plates, respectively.This can be explained by the discretization errors of the three meshes: 100 × 100 , 200 × 200 and 300 × 300 mesh nodes.In these cases, the estimated mesh error was between 6% and 8% for D, which can cause a significant effect in the interface curvature for cases with static droplets.
In the viscoelastic fluid flow cases, the simulation conditions follow the work of 47 .In this case, the viscoelastic parameter was specified based on the Weissenberg number, Wi = U H d , where is the relaxation time.The droplet deformation was computed for a range of varying Capillary number ( 0.1 < Ca < 2.5 ) with fixed Wi = 1 , = 1 , R = 2.5 and Q = 2.0 , and the results are compared against the predictions of the Taylor-theory and the simulations of 47 .
To evaluate the effect of viscoelastic fluids on a logic gate system, a modified geometry version of the system proposed by 48 and analyzed by 8,49 was used as a reference to verify our proposed methodology, as shown in Fig. 2. As in 8,49 , the inlet channels, named Tubes A and B , have width of 50 µ m and length of 500 µ m.Tube A + B has a width of 50 µm and a length of 500 µ m, and Tube A.B has a width of 25 µ m and a length of 500 µ m.Thus, Tube A + B has less hydrodynamic resistance since it has a larger hydraulic diameter than Tube A.B .It is expected that droplets coming from A and/or B will flow preferably to branch A + B due to its lower resistance.However, based on the balance between the hydrodynamic resistance and the resistance created by the blockage of an existing droplet, the droplet can choose between A + B or A.B .The droplet logic gate definition of AND and OR states takes into account these different dynamics.In our case, O R logic occurs when one droplet comes from either A or B and "decides" to go to A + B .AND happens when two droplets coming from A and B get together in a big droplet in the Tube C and eventually is split between tubes A + B and A.B .If the system respects either AND or OR gate, we classify the system as operational.
The boundary conditions for the simulations are Dirichlet boundary conditions for the velocity inlet, with different values specified depending on the case studied.For the pressure field, the Neumann boundary condition and thus zero gradients are specified.Zero gradients for velocity and constant pressure are set up in the outlet.At walls, the no-slip condition is enforced because, in this case, the slip length scale is of the order of magnitude of a nanometer, and the size of our geometry is in the micrometer size range.The first step is to obtain the best grid size for the simulations.Meshes of 28,918 (mesh 1), 107,888 (mesh 2), and 135,329 (mesh 3) nodes were used in the grid independence analysis.To evaluate the mesh convergence, the viscoelastic phase volume fraction along the tubes A + B and A.B in the middle of the tube A.B was compared for each mesh.In order to evaluate the worse scenario, the convergence is studied for the case with L/H = 1.4 , Ca = 0.1 and Wi = 4 for the AND at the time ( t = 1.5 × 10 −2 s) when the droplet reaches the connection between tubes C , A + B and A.B.

Classification model
In binary logic gate applications, one is interested in classifying data between two states.It is straightforward to realize that the binary neural network classification model is the right tool to predict the droplet-based logic gate state.All classification tasks depend upon labelled datasets; in our case, this dataset is provided by numerical simulation that transfers their knowledge to a neural network to learn the correlation between labels and data.Here, in order to build a reduced-order model (ROM) to predict operational conditions, several computational fluid dynamics simulations were performed to generate the dataset for the neural network, whose input data are the relevant physical dimensionless numbers of the problem.
The  these algorithms.For binary classification, the binary cross-entropy loss' function and Adam optimization algorithm optimizer were used to build our deep neural network logic gate ROM because it is a robust method to solve non-linear multidimensional classification problems, as in our case.Details related to the parameters of the dense neural network structure presented in this work will be provided in "Results and discussion" section.We seek for parameter Ŵ that minimizes the negative binomial log-likelihood (Eq 16).
where Loss(Ŵ) is the loss function to be minimized.The loss function uses y i and G(x i , Ŵ) as probability distribu- tions and measures the discrepancy between the neural network and the label, and x i are its input vector.The training process happens iteratively by computing loss function, Loss(Ŵ) , and updates the model until conver- gence.The trained model is then tested to assess metrics like accuracy and precision.

Results and discussion
This section is divided into three parts: in the first part, a code verification is performed for both a Newtonian and a viscoelastic droplets in an electric field, by comparing well-known analytical results for the Newtonian case and numerical results for the non-Newtonian case.In the second part, the influence of the viscoelastic surface and geometric parameters of the logic gate are analyzed.All data generated in the previous step was used to produce a binary classification model.Then, in the third part, we propose an electrically induced droplet formation method to control the logic gates system.

Verification: droplet deformation under electric field
In this section we describe the results obtained for the deformation of a Newtonian and a viscoelastic fluid droplet under a fixed electric field.In Fig. 3a, we show the obtained values for the droplet deformation parameter D under different R = σ 1 σ 2 for a Newtonian fluid droplet.One can see that our numerical results agree with the results obtained by 46 and with the theoretical predictions of 45 when we compare the droplet deformation D over time.There exists a slight discrepancy between the result presented here and 46 .The reason for this discrepancy can be interpreted as a result of spurious current present in the volume of fluid approach.We performed a mesh convergence analysis for this case by considering three mesh sizes ( 100 × 100 , 200 × 200 and 300 × 300 discretization nodes), and we concluded that the estimated mesh error was between 6% and 8% for D, which can cause a significant effect in the interface curvature for cases with static droplets.Figure 3b shows the the droplet deformation parameter D under different Ca E in a viscoelastic fluid droplet.It can be observed that the results presented here agree very well with the simulation result obtained by 47 .However, there is an enormous discrepancy between the Taylor theory linear analysis.This result was expected since all Taylor's theory is based on a Newtonian fluid and for a low Ca E number.As was also expected, for a low Ca E number, the deformation experienced by the viscoelastic fluid droplet is similar to a Newtonian fluid droplet because the electric field effect is too weak to produce an effective viscoelastic response.As the Ca E increases, the difference between the analytical and numerical solutions increases.

Mesh independency analysis
The mesh independency analysis results performed for the microfluidic logic gates are shown in Fig. 4. From Fig. 4a, one observes that meshes 2 and 3 match very well for the viscoelastic phase volume fractions.shows the velocity magnitude for meshes 1, 2, and 3, and we verifiy a close match between mesh 2 and 3 also for the velocity field.As it displays the best balance between accuracy and computational cost, we concluded mesh 2 (107,888 nodes) is the most efficient and was used for all the following simulations performed in this paper.

Viscoelastic analysis
In this section, the importance of the viscoelastic effect is investigated.First, from Fig. 5a,b, one can see the difference between the three rheological models.The ratio of the droplet length and tube width is 2. When the capillary number is 0.1, the logic gate is always operational.One can also observe that for the non-Newtonian fluids (either for viscoelastic or power-law model) there is a long "tail" of the fluid before its breaks.This behavior is not present in the Newtonian fluid.Note that for the capillary number is 0.1, the surface tension forces acting across the interface are weaker than the case with the capillary number 0.01, which provokes droplet breakage.In Fig. 5b, it is observed that there is also a longer tail for non-Newtonian fluids, but the operational condition is only feasible for a power-law model.In Fig. 5b, the power-law fluid operates correctly even for a low capillary number.This occurs because the local capillary number increases due to local viscosity increases in regions with shear rate increases (splitting region).
For power-law model the operation regimes were studied by 8 .Their research highlighted a fascinating phenomenon: as one increases the droplet length, capillary number, and power-law index, the operating range of the AND state expands, while that of the OR state contracts.This qualitative trend becomes evident in our own investigation.However, our focus lies in discerning disparities between operational conditions across different models, and we have indeed identified scenarios where these models diverge.Since power-law models are solely  www.nature.com/scientificreports/dependent on shear rate, we recognize that the Oldrog-B model can outperform power-law models, especially in capturing viscoelastic effects, owing to its fundamental theoretical basis for this class of fluids.Figure 6a,b compare the influence of the Weissenberg number (Wi) for different capillary numbers.The yellow fluid has Wi = 0.01 while the red fluid has Wi = 4 .We can see that for low Ca, the AND logic gate becomes non- operational for both cases.Figure 6a shows that when the elastic forces are dominant, the fluid tends to deform and form a long tail.In Fig. 6b, when the viscous forces are dominant, a tail is formed, but it is very prolonged due to the reduction of the capillary numbers.In this case, Ca is 10 times smaller and viscous and elastic forces are not able to break the droplets.
The initial size of the droplet is an important parameter in logic gates devices.Figure 7a,b compare the droplet initial size for the AND logic gate for Wi = 4 for ratios L/H equal to 2.4 (yellow droplet) and 1.4 (black droplet).We can see that the size influences the droplet when it is crossing the cross-junction.As expected, larger droplets are more likely to split since they experience a larger deformation, while smaller droplets experience a lower deformation and hence are less likely to break.
Figures 8 show the pressure and velocity profiles, respectively, for Wi = 4 and L/H = 2.4 with Ca = 0.01 and Ca = 0.1 during the AND breaking (or not) process in the cross-junction.From Fig. 8a, we can see a consider- ably higher pressure in Tube C for both cases.It was expected since the droplet blocks the connection between tubes A + B and A.B .It is also expected that the pressure will increase as the convective term becomes dominant compared to the surface force if one increases the Ca.In Fig. 8b, we can observe the consequences of the higher pressure for Ca = 0.1 ; the fluid tends to break easily, as is expected since the energy to break the interface is less than for Ca = 0.01 .This result plays an important role in the critical operational condition point.according to our result, the Ca is the most important parameter in the logic gate operational condition.This will be further described in the next section.
Figure 9 show the pressure and velocity profiles, respectively, for Wi = 4 and L/H = 2.4 with Ca = 0.01 and Ca = 0.1 during the O R breaking (or not) process in the cross-junction.Figure 9a,b are the pressure profiles, and the results show that if one increases Ca it is more likely to break the droplet.However, in this case, as it is a OR logic gate, the breakage is not intended, and therefore, a low Ca number is required.

Electric field effect
An operational condition occurs when a predefined droplet logic gate is performed properly by the droplet, otherwise is a non-operational condition.In order to guarantee operational conditions, here we propose to control a droplet-based microfluidic device with an external electrical force.We include two electrodes at the whole walls  of the tube A.B to create an additional force (produced by an electric potential difference) that attracts or repels a droplet in a 2D cross-junction.For the AND logic gate, this external force should attract the droplet and force it to break in two.This task is not straightforward because the potential applied to the electrodes should be strong enough to attract the droplet but weak enough to not attract the whole droplet instead of breaking it.For the OR logic gate, this external force should repel the droplet.In this last case, this is more straightforward since the force should only be strong enough to repel the droplet to avoid a non-operational condition.It is important to point out that electric fields is being used to manipulate droplets for different applications 2 , such as: elestrospray and electrocoalescence.The application of an electric field affects the surface energy of the droplet, enabling precise control over its movement and behavior.Moreover, this process induces a non-uniform charge density within the droplet (as described in Equation 12) that can be leveraged to exert control over the droplets.In this section, we proved that the logic gate regimes can be altered by the electric field.
Figure 10a,b show results for the AND logic gate for Wi = 4 and L/H = 2.4 with Ca = 0.01 , such that the logic gate would be non-operational a priori.However, applying an electric force in a fluid with R = 1 × 10 1 , Q = 1 × 10 −1 and Ca E = 1 × 10 −10 , one can see that the droplet is attracted (see Fig. 11a to the electrodes.Fig- ure 11a shows the result an instant before the droplet breaks, while Fig. 11b shows the droplet after it is already broken.Suppose a strong electric force is applied instead of completing the logic gate; in that case, the droplet is stuck in the tube A.B .In these electrodes, the boundary conditions is a specified potential (based on the Ca E ) and with a zero initial charge concentration.In order to avoid trapping the droplet, the application of the external force application follows a step function with the frequency of half of the advective time.From Fig. 10a, one can see that the negative charge is concentrated near the electrodes with a positive potential (see Fig. 10b), thus attracting the droplet.This effect depends on the fluid properties; however, it is beyond the scope of the present manuscript to evaluate the fluid properties in the droplet attraction.We only aim to show that an external electric force can turn a non-operational system into an operational one.
In Fig. 11, we study an OR logic gate for Wi = 4 and L/H = 2.4 with Ca = 0.01 , where the logic would be non-operational in the absence of an electric field.When we applied an electric force, with R = 1 × 10 −6 , Q = 1 × 10 5 and Ca E = 3 × 10 −11 , the droplet was repelled and the system became operational.However, in that case, there is no need to apply a periodic potential in the electrodes since the droplet can be stuck.shows the droplet being "pushed" to tube A + B .As is expected, the force is more intense near the electrodes.When the droplet enters the tube A + B , the electric force effect reduces drastically, as can be seen in Fig. 11d.The negative charge is closer to the electrodes, and the electric force repels the droplet, as can be seen in Figs.10c and 11c due to the electric field effect, see Fig. 10d.

Binary classification ROM
In binary logic gates, the logic is classified into two states.Instead of creating a complex regime map separated by logic and parameters as in 8 , we modelled the binary logic with a reduced-order model (ROM) based on a binary deep neural network.Thus, a general formulation can be based on critical dimensionless parameters.In order to produce data for the training, several simulations were performed for AND and OR logic gates, see Table 1.The data set has 210 entries for each logic gate, with a total of 420 samples.
TensorFlow was used for the classification model training.We employ the binary cross-entropy loss function and Adam optimization algorithm optimizer for binary classification.The binary cross-entropy is very robust in solving non-linear multidimensional classification problems 50 .Figure 13 shows the deep neural network accuracy for the training and validation step for a simple topology with 10 neurons with 3 layers.For the first two layers, relu and for the last, sigmoid activation functions were used.For the model generation, we used a total of 3000 epochs with a batch size of 500, considering 20% for validation and 10% for testing our classification model.Finally, the accuracy in the test (unseen data) evaluation was 92%.If AND or OR logic gates work, the classification model would return 1; otherwise, 0 without needing a regime map.This result can be used to estimate the viability of a logic gate without expensive simulations.The average computational time for each simulation is around 2 h in a computer with an Intel Xeon E5-2640 v4 2.4 GHz but using the classification model takes less the 1 s.
In Fig. 12, we analyze how well a classification model performs.The confusion matrix provides a snapshot of the model's predictions versus the actual outcomes, allowing us to calculate different performance metrics based

Conclusions
In our study on droplet-based logic gate systems operating with viscoelastic fluids, we investigated the influence of viscoelasticity on the operational conditions using the AND/OR system proposed by 48 as a basis.We observed that the behavior of viscoelastic fluids, following the power-law model, can significantly impact the dynamics of the logic gates compared to Newtonian fluids.Therefore, it is crucial to consider the rheological model to obtain realistic results, and simplifications using either a Newtonian or power-law model may lead to unrealistic conclusions.To understand the system dynamics, we studied the Weissenberg number (Wi), the Capillary number (Ca), and the geometric droplet parameters.We found that all these parameters can influence the system dynamics, but the Capillary number has emerged as the most important factor, which is consistent with the findings reported by 8 .To improve the prediction of operational conditions and accelerate the process without relying on complex simulations, we employed a deep learning (DL) classification algorithm to develop a reduced-order model.This DL model enabled us to predict the operational conditions beyond the range of our existing data.Furthermore, we demonstrated that non-operating regions can become operational by applying an external force.Although we did not specifically analyze the influence of fluid properties in this study, we showed that applying an electric field to the outlet tubes using an electrically induced technique can transform the system from non-operational to operational conditions.Overall, our research highlights the importance of considering viscoelastic properties and the rheological model in droplet-based logic gate systems.The developed DL model provides a valuable tool for predicting operational conditions and offers insights into the potential for external interventions to induce system operability.Future studies may explore the influence of fluid properties and further optimize the electrically induced technique to enhance the performance and applicability of these systems.
TensorFlow 50 , open-source software library developed by Google was used for the classification model training.It provides an interface for expressing machine learning algorithms and an application for executing (15) D = 9 16

Figure 2 .
Figure 2. Logic gate geometry.Channels A and B are inlets; and A + B and A • B are outlets.

Figure 3 .
Figure 3. Droplet deformation, D, versus the dimensionless parameter R for a Newtonian fluid for Q = 10 for the Newtonian case, specifying the Re = UR d ν 2 = 0.09 , Ca E = ǫ 2 R d E•E γ = 0.18 and β = ν 1 ν 2 = 1 .(a) Versus the capillary number Ca E for a viscoelastic fluid for R = 2.5 and Q = 2.0 (b).

2 √
4 and capillary number is 0.1 and 0.01 for Fig. 5a,b, respectively; The red fluid is a viscoelastic fluid with Wi = 4 .The blue fluid follows the power-law model, µ = K 1 S : S n−1 with K = µ s and n = 1.3 ; the green fluid is a Newtonian fluid with viscosity equal to µ = K = µ s with surface tension of 0.02 N/m, disregarding the contact angle effect.Figure 5a,b show the results in the cross-junction between tubes A + B and A.B for an AND logic gate when the droplets should break.One can see from Fig. 5a that the rheological model strongly influences the breakage dynamics.

Figure 4 .
Figure 4. Comparison of velocity magnitude [m/s] (a) and volume fraction (b) for different mesh sizes on the centerline of channel A • B.

Figure 5 .
Figure 5. AND logic gate for different fluid models with Wi = 4 and L/H = 2.4 for Ca = 0.1 (a) and Ca = 0.01 (b).The red fluid is the viscoelastic fluid, green is the Newtonian fluid and blue is the power-law fluid with n = 1.3.

Figure 6 .
Figure 6.Influence of the Weissenberg number (Wi) for different capillary numbers of the viscoelastic fluid.The yellow fluid has Wi = 0.01 while the red fluid has Wi = 4 .Both fluids have Ca = 0.1 (a) and Ca = 0.01 (b).

Figure 7 .
Figure 7.Comparison of the droplet initial size for the AND logic gate for Wi = 4 for ratios L/H equal to 2.4 (yellow droplet) and 1.4 (black droplet) for Ca = 0.1.

Figure 8 .
Figure 8.Comparison of the pressure field [Pa] (a,b) and the velocity magnitude fields [m/s] (c,d) for AND logic gate with Wi = 4 and L/H = 2.4 with Ca = 0.1 (a,c) and Ca = 0.01 (b,d).

Figure 10 .
Figure 10.Electric charge distribution [C/m 3 ] (a,c) and the electric potential field [V] (b,d) for AND (a,b) and OR (c,d) logic gate for Wi = 4 and L/H = 2.4 with Ca = 0.01 where the logic would be non-operational without an electric field.

Figure 11 .
Figure 11.Electric force magnitude field [N/m 3 ]in AND (a,b) and OR (c,d) logic gates for Wi = 4 and L/H = 2.4 with Ca = 0.01 where the logic would be non-operational without an electric field, before (a,c) and after (b,d) the droplet is pushed to A + B.

Figure 12 .
Figure 12.Confusion matrix over a test set.

Figure 13 .
Figure 13.Classification accuracy for training and validation.

Table 1 .
Dimensionless parameters used in the training step (total of 420 data).